package com.zhuiyun.educations.api.information.controller;

import com.zhuiyun.educations.annotation.OptLog;
import com.zhuiyun.educations.api.information.entity.InformationFile;
import com.zhuiyun.educations.api.information.service.InformationFileService;
import com.zhuiyun.educations.common.response.CommonResult;
import com.zhuiyun.educations.util.constants.CommonConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName InformationFileController
 * @Description TODO 资料管理
 * @Author ys
 * @Date 2023/6/21 14:51
 **/
@Slf4j
@RestController
@Api(tags = "课程价钱")
@RequestMapping("/informationFile")
public class InformationFileController {
    @Resource
    InformationFileService informationFileService;
    /**
     * 添加
     * @param file,informationFile
     * @return
     */
    @PostMapping("/informationFileAdd")
    @ApiOperation(value = "资料管理的添加方法")
    public CommonResult informationFileAdd(MultipartRequest file, InformationFile informationFile) {
        return CommonResult.ok(informationFileService.informationFileAdd(file, informationFile));
    }
}
